package com.project.service;

import com.project.service.base.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.project.dao.ChoiceMapper;
import com.project.entity.Choice;
/**
 * Created by root on 4/12/2018.
 */
@Transactional(noRollbackFor = Exception.class)
@Service
public class ChoiceServiceImpl extends BaseService implements ChoiceService {

    @Autowired
    private ChoiceMapper choiceMapper;

    @Override
    public void add(Choice choice){
        choiceMapper.insertSelective(choice);
    }

    @Override
    public Choice findByExerciseInfoId(Integer exerciseinfoid) {
        return choiceMapper.selectByExerciseInfoId(exerciseinfoid);
    }

    @Override
    public int modify(Choice choice)
    {
        return choiceMapper.updateByPrimaryKeySelective(choice);
    }
}
